// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   EBankResult.java

package com.vandagroup.common.msgexchange;

import com.vandagroup.common.bean.BaseBean;
import com.vandagroup.common.util.Result;
import java.io.PrintStream;
import java.util.Hashtable;

// Referenced classes of package com.vandagroup.common.msgexchange:
//            MessageWrapper

public class EBankResult extends Result
{

    private Hashtable singleResult;
    protected int resultSize;
    protected boolean multiResultTag;
    protected String tranCode;

    public EBankResult()
    {
        singleResult = null;
        resultSize = 0;
        multiResultTag = false;
        tranCode = "";
        singleResult = new Hashtable();
    }

    public EBankResult(Hashtable singleResult)
    {
        this.singleResult = null;
        resultSize = 0;
        multiResultTag = false;
        tranCode = "";
        this.singleResult = singleResult;
    }

    public EBankResult(Hashtable singleResult, BaseBean aBaseBeans[])
    {
        this.singleResult = null;
        resultSize = 0;
        multiResultTag = false;
        tranCode = "";
        this.singleResult = singleResult;
        baseBeans = aBaseBeans;
    }

    public String getRespCode()
    {
        return getSingleResult(MessageWrapper.RESPCODETAG);
    }

    public String getRespMsg()
    {
        return getSingleResult(MessageWrapper.RESPMSGTAG);
    }

    public String getSingleResult(String paramName)
    {
        String result = null;
        try
        {
            result = (String)singleResult.get(paramName);
            result = result.trim();
        }
        catch(Exception e)
        {
            System.err.println("'" + paramName + "' is not exist in singleResult");
        }
        return result;
    }

    public String getResult(String paramName)
    {
        String result = getSingleResult(paramName);
        if(result == null)
            result = (String)getBaseBeans()[0].get(paramName);
        return result;
    }

    public void setSingleResult(String paramName, String value)
    {
        singleResult.put(singleResult, value);
    }

    public boolean hasMultiResult()
    {
        return multiResultTag;
    }

    public String getTranCode()
    {
        return tranCode;
    }

    public void setTranCode(String tranCode)
    {
        this.tranCode = tranCode;
    }

    public String genTranCodeTag()
    {
        return "<input type=hidden name='lastTranCode' value='" + tranCode + "'>";
    }
}
